package com.sciencep.pro.core.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sciencep.pro.common.domain.QueryRequest;
import com.sciencep.pro.common.domain.ResponseResult;
import com.sciencep.pro.common.exception.CustomException;
import com.sciencep.pro.core.domain.dto.dropdown.ProSelectVO;
import com.sciencep.pro.core.domain.dto.home.ParticipatedInInfoVO;
import com.sciencep.pro.core.domain.dto.project.*;
import com.sciencep.pro.core.domain.dto.user.UserDetail;
import com.sciencep.pro.core.domain.entity.ProBaseInfo;
import com.taobao.api.ApiException;

import java.text.ParseException;
import java.util.List;
import java.util.Map;

/**
 * @author Sciencep
 */
public interface IProBaseInfoService extends IService<ProBaseInfo> {


    /**保存项目
     * @param projectTO
     * @throws Exception
     */
    ResponseResult<Object> saveProject(ProjectTO projectTO, UserDetail userDetail)throws CustomException;


    void updateProject(ProjectTO projectTO, UserDetail userDetail)throws CustomException;

    /**编辑初始化
     *
     *
     */
    ProjectTO editProjectInit(ProBaseInfo proBaseInfo) throws ParseException;

    /**项目详情
     *
     *
     */
    ProjectTO getProjectInfo(ProBaseInfo proBaseInfo) throws ParseException;

    /**延期的项目
     *
     *
     */
    ProjectTO getDelayedProject(ProBaseInfo proBaseInfo);


    /**
     * 变更项目
     * @param changeTO
     */
    String changeProject(ProjectChangeTO changeTO,UserDetail userDetail) throws CustomException;

    void auditChange(ProChangeAuditTO proChangeAuditTO,UserDetail userDetail) throws CustomException;

    /**
     * 获取项目编号
     */
    ProjectTO getProjectCode(ProBaseInfo proBaseInfo);

    List<ProSelectVO> getInprocessingProList(String userId);

    List<ProSelectVO> getAll();

    List<ProSelectVO> getProAndBakList();
    /**
     * 项目人天统计
     *
     * @param proNo
     * @param type
     * @return
     */
    List<MandayStatisticsChartTO>  getMandayStatisticsChart(String proId,String proNo, Integer type);


    List<BurndownChartTO> getBurndownChartTO(String proId,String proNo);

    List<WorkloadTrendChartTO> getWorkloadTrendChartTOList(String proId,String proNo);

    Integer getDelayCount();

    ProChangeDetailTO getProChangeDetailTO(String proId,String proNodeId);

    List<ProDataTO> getProjectInfoData(String proId);

    void saveToDingDing(ProjectTO projectTO,UserDetail userDetail) throws CustomException, ApiException;

    List<Map<String,Boolean>> getWorkDay(String beginDate,String endDate) throws ParseException;

    ProBaseInfo finishProject(ProBaseInfo proBaseInfo);

    ProBaseInfo updateContractCode(ProBaseInfo proBaseInfo);

    Page<ParticipatedInInfoVO> getMyProject(String userId, QueryRequest queryRequest);
}
